/*
 * Platzad
 * Copyright 2008 Shayne Riley
 *
 * This file is part of Platzad.
 *
 * Platzad is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Platzad is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Platzad.  If not, see <http://www.gnu.org/licenses/>.
 *
 * To contact the authors on questions or issues regarding the license,
 * you may send an email to <shayner at gmail dot com> or write to
 * Shayne Riley / P.O. Box 1092 / McCook, NE 69001.
 */

#ifndef CONTROLRECEIVER_H_
#define CONTROLRECEIVER_H_

#include <iostream>

namespace pzdControl
{

//! Classes implementing this will be called whenever associated input is
//! received from the user.
/**
 * For example: the user wants his avatar
 * to jump. He presses the button that makes the avatar jump. In the control
 * sub-system, this button input is received from the hardware. This button
 * is assigned to a ControlReceiver, which has a method called whenever the
 * button is pressed.
 *
 * The ControlReceiver is set up to remove the logic of what happens when the
 * button is pressed (the avatar bumps a wall above his head, or gets affected
 * by gravity, etc.), but still have an in-game action associated with it.
 *
 * A Functor (or Functionoid)
 * (http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.10)
 * acts like a function pointer.
 */
class ControlReceiver
{
public:
	//! Gets called whenever a button assigned to this class is called.
	/**
	 * @param data	Does not really mean anything. In fact this will change.
	 */
	virtual void operator()(std::string data) = 0;
	virtual ~ControlReceiver() = 0;
};

}

#endif /*CONTROLRECEIVER_H_*/
